package com.zzf.uiwidgetest

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        button.setOnClickListener {
//            Toast.makeText(this, "点击了按钮", Toast.LENGTH_SHORT).show()
//         val inputText = editText.text.toString()
//            Toast.makeText(this, inputText, Toast.LENGTH_SHORT).show()
//            imageView.setImageResource(R.mipmap.img2)
//            if (progressBar.visibility == View.VISIBLE){
//                progressBar.visibility = View.GONE
//            }else{
//                progressBar.visibility = View.VISIBLE
//            }

//            progressBar.progress = progressBar.progress + 10

            AlertDialog.Builder(this).apply {
                setTitle("这是一个对话框")
                setMessage("对话框的内容")
                setCancelable(false)

                setPositiveButton("OK") {
                    dialog,which ->

                }

                setNegativeButton("Cancel") {
                    dialog,which ->

                }

                show()
            }
        }
    }
}